public class Main {
    public static boolean isPalindrome(String s) {
        if(s == null)
            return true;
        s = s.toLowerCase();

        StringBuilder str = new StringBuilder(s.length());

        for(int i = 0; i<s.length(); i++){
            if((s.charAt(i) <= 'z' && s.charAt(i) >= 'a') || (s.charAt(i) <= '9' && s.charAt(i) >= '0')){
                str.append(s.charAt(i));
            }
        }

        return str.toString().equals(str.reverse().toString());
    }


    

    public static void main(String[] args) {
        String s = "0P";
        boolean index = isPalindrome(s);

        System.out.println(index);


    }

}
